#include <stdio.h>
#define N 41
int ReadScore(int score[], long num[]);
int FindMax(int score[], int n);
int main(void)
{
int score[N], maxNum, n;
long num[N];
n = ReadScore(score, num);
printf("Total students are %d\n", n);
maxNum = FindMax(score, n);        
printf("The highest is %ld, score is %d\n", num[maxNum], score[maxNum]);
return 0;
}

int ReadScore(int score[], long num[]){
	int cur,i=0;
	long id;
	while ((scanf("%ld %d",&id,&cur)) && cur!=-1 && id!=-1 ){
		score[i]=cur;
		num[i]=id;
		i++;
	}
	return i;
}

int FindMax(int score[], int n){
	int i,max_i=0;
	for (i=0;i<n;i++){
		max_i = score[i]>score[max_i]?i:max_i;
	}
	return max_i;
}
